package com.happypets.daoImpl;

import java.util.List;

import com.happypets.dao.PetDao;
import com.happypets.model.PetBean;
import com.happypets.utils.DB;
import com.happypets.utils.DBUtils;

public class PetDaoImpl implements PetDao {
	private static DB db = null;
	private static DBUtils dbUtils = null;
	
	static{
		db = new DB();
		dbUtils = new DBUtils();
	}
	
	public int addPet(PetBean pet) {
		return 0;
	}

	public int delete(String id) {
		return 0;
	}

	public int delete(PetBean pet) {
		return 0;
	}

	public int update(PetBean pet) {
		return 0;
	}

	public List<?> query(String sql) {
		
//		return db.getMapInList(sql);
		return dbUtils.queryByList(sql);
	}

	public int excutQuery(String sql) {
		
//		return db.excuteQuery(sql);
		return dbUtils.execute(sql);
	}

	@Override
	public String getString(String sql) {
		
//		 return db.getStr(sql);
		return dbUtils.query_str(sql);
	}
	
	/**
	 * 处理池
	 * @param sql
	 * @return
	 */
	public int[] excuteBatch(String[] sql){
		
		return dbUtils.updateBatch(sql);
		
	}

}
